<?php
/**
 * 描述：数据-分类。
 * @final
 */
final class Exec_Data_Category extends Exec
{
    public function Get()
    {
        $type=Functions::UrlArgs('type');
        if($type!='class'&&$type!='subclass'){
            return;
        }
        if($type=='subclass')
        {
            $identifying=Functions::UrlArgs('identifying');
            if(!is_numeric($identifying)){
                return;
            }
        }

        $tmp=NULL;
        if($type=='class'){
            $data=DB::GetRows('select * from category where Identifying_Parent is NULL order by ID asc');
        }
        else{
            $data=DB::GetRows('select * from category where Identifying_Parent='.$identifying.' order by ID asc');
        }
        
        foreach($data as &$row)
        {
            $tmp=$tmp.($row['Name'].'-'.$row['Identifying'].'|');
        }
        echo substr($tmp,0,strlen($tmp)-1);
    }
}
?>